package cn.tomoki.myapplication;
import android.view.View;

public class Utils {
//    public static String classroomUrl = "http://10.168.14.139:8081";
    public static String classroomUrl = "http://1.116.106.145:8081";
    public static String myUrl = "http://192.168.43.105:8081";
    private static Thread t;
    public static void flush(View view){    //刷新界面
         t = new Thread(new Runnable() {
            @Override
            public void run() {
                while (!Thread.currentThread().isInterrupted()) {
                    try {
                        Thread.sleep(100);

                    } catch (InterruptedException e) {

                        Thread.currentThread().interrupt();

                    }

                    //使用postInvalidate可以直接在线程中更新界面

                    view.postInvalidate();

                }
            }
        });
    }
    public static void finish(){
        t.interrupt();
    }
}
